﻿using Domain.Entities;
using Domain.Views;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
using EFcore.Mapping;

namespace EFcore
{
    public class JFDbContext : DbContext
    {
        //Add-Migration JFNETCORE; Update-Database JFNETCORE
        public JFDbContext(DbContextOptions<JFDbContext> options) : base(options)
        {

        }

        public DbSet<User> Users { get; set; }
        public DbSet<Product> Product { get; set; }
        public DbSet<ProductType> ProductType { get; set; }
        public DbSet<Article> Article { get; set; }
        public DbSet<ArticleType> ArticleType { get; set; }
        public DbSet<Reply> Reply { get; set; }
        public DbSet<Role> Role { get; set; }
        public DbSet<Menu> Menu { get; set; }
        public DbSet<RoleMenu> RoleMenu { get; set; }
        public DbSet<Config> Config { get; set; }
        public DbSet<Log> Log { get; set; }

        //public virtual DbSet<ProductView> ProductView { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            //modelBuilder.Entity<ProductView>(ProductViewMap.ProductView);
            base.OnModelCreating(modelBuilder);
        }
    }
}
